/*
ID:luongho3
LANG:JAVA
TASK:friday
 */
package usaco.training.chap1.sec1;

import java.io.File;
import java.io.PrintStream;
import java.util.Scanner;

public class friday {

	static int N, start;
	static int[] count = {0,0,0,0,0,0,0};

	public static void main(String[] args) throws Exception {
		Scanner scanner = new Scanner(new File("friday.in"));
		PrintStream ps = new PrintStream(new File("friday.out"));
		System.setOut(ps);

		start = 1;
		N = scanner.nextInt();
		for (int i=0;i<N;++i) {
			for (int j=0;j<12;++j) {
				int next = getNext(i,j); // how many days to the next 13th
				start = (start + next) % 7;
				count[start]++;
			}
		}
		System.out.print(count[6] + " ");
		for (int i=0;i<6;++i) {
			System.out.print(count[i]);
			if (i == 5) {
				System.out.println();
			}
			else {
				System.out.print(" ");
			}
		}
	}

	private static int getNext(int year, int month) {
		switch (month) {
		case 0:
			if (year == 0) {
				return 12;
			}
			else {
				return 31;
			}
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:
		case 1:
			return 31;
		case 4:
		case 6:
		case 9:
		case 11:
			return 30;
		case 2:
			if (leap(1900+year)) {
				return 29;
			}
			else {
				return 28;
			}
		}
		return 0;
	}

	private static boolean leap(int year) {
		if (year %4 == 0) {
			if (year % 100 == 0) {
				if (year % 400 == 0) {
					return true;
				}
				else {
					return false;
				}
			}
			else {
				return true;
			}
		}
		return false;
	}

}
